The present invention relates to a compiler for generating object code by compiling a source program expressed in a high-level language and to a data processor for executing an object program generated by the compiler, particularly to a technique to be effectively applied to a computer corresponding to, for example, a RISC (Reduced Instruction Set Computer) architecture and a compiler for such as architecture.
In a compiler for generating object codes by compiling a source program, information depending on the hardware such as the register constitution of a data processor (target machine), which is the object of the compiler is interpreted and register allocation of variables and rearrangement of instructions are performed in a code generation step which is the final stage. In this step, a branch table, a loop table, and a register allocation table are generated. Such information can be placed as the control information depending on the hardware of the subject data processor and obtained by the compiler in its processing step.
In this case, the processing speed of a data processor such as a microcomputer is increased by using techniques such as pipeline processing and cache memories. Correspondingly, a compiler may be designed to perform various optimization processes for improving the efficiency of execution of an object in conformity with the hardware of the object data processor. For example, as disclosed in Japanese Patent Laid-Open Nos. 135630/1991 and 282734/1991, compilers are disclosed which perform scheduling of instructions by considering the pipeline processing of the data processor or hardware such as cache memories and inserting a no-operation instruction into an instruction code string for code optimization and instruction scheduling. Therefore, when the compiler intends to generate an object code with a high execution efficiency in conformity with the hardware of an object data processor having advanced functions, the compiler has to receive various pieces of information adapted to the hardwares of the object data processor and make the most of them.